let { Schema, model } = require("mongoose");
let {TestPaperModel} = require("./testPaperModel")



let typesSchema = new Schema({
    type: String
  })
  let typesModel = model("typesModel", typesSchema, "types")
  
  



let TestSchema = new Schema({
    title: String, // 试卷标题
    date: String, // 考试时间
    time: String, // 答题时长
    typeId: {
        type: Schema.Types.ObjectId,
        ref: typesModel
    },
    exercisesId: [  // 当前试卷关联的所有题目 _id
        {
            type: Schema.Types.ObjectId,
        	ref: TestPaperModel
        }
    ] 
})
let TestModel = model("TestModel", TestSchema, "tests")

module.exports = {TestModel}